// pages/team/order_rank.js
import { OrderRank } from '../../model/order-rank.js';
var order_rank = new OrderRank();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    hidden: false,
    teamUser: [],
    user_id: 0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    if (options.user_id) {
      this.setData({
        user_id: options.user_id
      })
    }
    wx.showLoading({
      title: '加载中',
    });
    this.getOrderRank();
  },
  onTel(e) {
    wx.makePhoneCall({
      phoneNumber: e.currentTarget.dataset.phone
    })
  },
  getOrderRank() {
    order_rank.getTeamOrderList(this.data.user_id,(res) => {
      this.setData({
        hidden: true,
        teamUser: res
      })
      wx.hideLoading();
    })
  }
})